//************************************************************************
//     dfsocket.h
//     2009 © DigiFi Limited
//
//     Generic definition for how we want to communicate with sockets
//     
//
//************************************************************************

#ifndef DFSOCKET_HEADER
#define DFSOCKET_HEADER


#define DFSOCKET_TIMEOUT		-1011
#define DFSOCKET_DISCONNECTED	-1012
#define DFSOCKET_NOMEM			-1013



int dfsocket_connect(char *ipAddress, int port);


int dfsocket_send(int id, const void *buffer, int length);


int dfsocket_receive(int id, void *buffer, int length);


// 1=Read 2=Write
int dfsocket_poll(int id, int timeout, int type);


void dfsocket_disconnect(int id);


char* dfsocket_getlocalip(void);

int dfsocket_unbind(int id);

int dfsocket_listen(int port);

int dfsocket_accept(int id);

int dfsocket_set_nonblocking(int id);
int dfsocket_set_blocking(int id);


#endif